<?php $this->load->view('header_view')?>	
    
    <div id="main">
		<?php echo form_open_multipart($this->uri->uri_string(),array('id'=>'f_submit'));?>
		<?php echo validation_errors();?>
        <table>
			<tr>
				<td><?php echo $this->lang->line('title');?></td>
				<td><input type="text" id="tf_title" name="tf_title" value="<?php echo $form_info['title']?>"></td>
			</tr>
			<tr>
				<td><?php echo $this->lang->line('image');?></td>
				<td>
                	<div id="div_uri_path">
                    <?php 
					if ($form_info['image']) {
						foreach ($form_info['image'] as $row) {
							echo '
								<div><input type="checkbox" id="ckb_uri_path[]" name="ckb_uri_path[]" value="'.$row['uri_path'].'" checked>
									 <span id="messages" style="display:inner-block;font-weight:bold; color:red;">'.$row['uri_path'].'</span>
									 <img width="50px" height="50px" src="'.base_url().'images/upload/'.$row['uri_path'].'"></div>
							';	
						}	
					}
					?>
					</div>
					<br />
					<input type="file" id="fileToUpload" name="fileToUpload" value="">
					<a href="javascript:;" id="clickhere" onclick="return ajaxFileUpload();">click to upload</a>
					<img id="loading" src="<?php echo base_url()?>images/loading.gif" style="display:none;">
					</fieldset>
				</td>
			</tr>
			<tr>
				<td><?php echo $this->lang->line('condition');?></td>
				<td><input type="text" id="tf_condition" name="tf_condition" value="<?php echo $form_info['condition']?>"></td>
			</tr>
			<tr>
				<td><?php echo $this->lang->line('detail_content');?></td>
				<td>
					<?php 
						$data = array(
							'basepath'    => base_url().'fckeditor/',	
						  	'name'        => 'ta_detail_content',
						  	'id'          => 'ta_detail_content',
						  	'height'      => '300px',
							'value'		  => $form_info['detail_content'],								
					    );
					
						echo form_fckeditor( $data ); 
					?>
				</td>
			</tr>
			<tr>
				<td><?php echo $this->lang->line('price');?></td>
				<td><input type="text" id="tf_price" name="tf_price" value="<?php echo $form_info['price']?>"></td>
			</tr>
			<tr>
				<td><?php echo $this->lang->line('price_discount');?></td>
				<td><input type="text" id="tf_price_discount" name="tf_price_discount" value="<?php echo $form_info['price_discount']?>"></td>
			</tr>
			<tr>
				<td><?php echo $this->lang->line('country')?></td>
				<td>
					<select id="sl_country_id" name="sl_country_id">
						<option value="0">--<?php echo $this->lang->line('choose_country')?>--</option>
                        <?php 
							foreach ($country_info as $row) {
							echo '<option value="'.$row['id'].'" '.(($row['id']==$form_info['country_id'])?"selected":"").'>'.$row['name'].'</option>';
						}
						?>
					</select>
				</td>
			</tr>
			<tr>
				<td><?php echo $this->lang->line('city')?></td>
				<td>
					<select id="sl_city_id" name="sl_city_id">
						<option value="0">--<?php echo $this->lang->line('choose_city')?>--</option>
                        <?php 
						foreach ($city_info as $row) {
							echo '<option value="'.$row['id'].'" '.(($row['id']==$form_info['city_id'])?"selected":"").'>'.$row['name'].'</option>';
						}
						?>
					</select>
				</td>
			</tr>
			<tr>
				<td><?php echo $this->lang->line('district')?></td>
				<td>
					<select id="sl_district_id" name="sl_district_id">
						<option value="0">--<?php echo $this->lang->line('choose_district')?>--</option>
						<?php 
						foreach ($district_info as $row) {
							echo '<option value="'.$row['id'].'" '.(($row['id']==$form_info['district_id'])?"selected":"").'>'.$row['name'].'</option>';
						}
						?>
					</select>
				</td>
			</tr>
			<tr>
				<td><?php echo $this->lang->line('address');?></td>
				<td>
					<input type="text" id="tf_address" name="tf_address" value="<?php echo $form_info['address']?>">
					<a href="javascript:;" id="map" name="map">Display on map</a>
					<input type="text" id="tf_geo_location" name="tf_geo_location" value="<?php echo $form_info['geo_location']?>">
				</td>
			</tr>
			<tr>
				<td><?php echo $this->lang->line('phone');?></td>
				<td><input type="text" id="tf_phone" name="tf_phone" value="<?php echo $form_info['phone']?>"></td>
			</tr>
			<tr>
				<td><?php echo $this->lang->line('date_begin');?></td>
				<td><input type="text" id="tf_date_begin" name="tf_date_begin" value="<?php echo datetime_show($form_info['date_begin'])?>"></td>
			</tr>
			<tr>
				<td><?php echo $this->lang->line('date_end');?></td>
				<td><input type="text" id="tf_date_end" name="tf_date_end" value="<?php echo datetime_show($form_info['date_end'])?>"></td>
			</tr>
			<tr>
				<td><?php echo $this->lang->line('quantity');?></td>
				<td><input type="text" id="tf_quantity" name="tf_quantity" value="<?php echo $form_info['quantity']?>"></td>
			</tr>
			<tr>
				<td>&nbsp;</td>
				<td><input type="submit" id="btn_submit" name="btn_submit" value="Submit"></td>
			</tr>	
		</table>
		<?php echo form_close();?>
    </div>
    
<?php $this->load->view('footer_view')?>